//
//  MOProdectFootView.m
//  FastDoctor
//
//  Created by 冯龙飞 on 16/5/21.
//  Copyright © 2016年 冯龙飞. All rights reserved.
//

#import "MOProdectFootView.h"
#import "Masonry.h"

@interface MOProdectFootView ()

@property(nonatomic, copy) UILabel * exchange;

@property(nonatomic, copy) UILabel * version;

@end

@implementation MOProdectFootView

// 在初始化方法中添加子控件以及赋值
- (instancetype)initWithFrame:(CGRect)frame {
    
    if ([super initWithFrame:frame]) {
        
        self.exchange.text = @"用户交流群:123455";
        self.version.text = @"Version:1.0.1";
        
        self.exchange.textColor = [UIColor greenColor];
        self.version.textColor = [UIColor grayColor];
        
        [self addSubview:self.exchange];
        [self addSubview:self.version];
    }
    
    return self;
}

// 在这个方法中布局子控件
- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    [self.version mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.centerX.equalTo(self);
        make.bottom.equalTo(self).offset(-20);
        
    }];
    
    [self.exchange mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.centerX.equalTo(self);
        make.bottom.equalTo(self.version).offset(-40);
        
    }];
    
}

- (UILabel *)exchange {
    
    if (_exchange == nil) {
        _exchange = [[UILabel alloc]init];
    }
    return _exchange;
}

- (UILabel *)version {
    
    if (_version == nil) {
        _version = [[UILabel alloc]init];
    }
    return _version;
}

@end
